<?php

Route::get('/', 'IndexController@index');
Route::group(['prefix' => 'steam'], function () {
    Route::get('/verify', 'Auth\AuthSteamController@steamVerify');                //Steam验证
    Route::get('/register', 'Auth\AuthSteamController@steamRegister');             //验证返回注册
    Route::get('/login', 'Auth\AuthSteamController@steamLogin')->name('steam.login');                 //Steam登陆
});
Route::post('/register', 'Auth\RegisterController@register');
Route::get('/login', 'Auth\LoginController@loginPage')->name('login');
Route::post('/login', 'Auth\LoginController@login');
Route::post('/logout', 'Auth\LoginController@logout');
Route::get('/password/reset', 'Auth\ResetPasswordController@passwdReset');
Route::post('/reset/email', 'Auth\ResetPasswordController@sendResetEmal');
Route::get('/reset/pw', 'Auth\ForgotPasswordController@resetPw');
Route::post('/reset/pw', 'Auth\ForgotPasswordController@setPassword');
Route::group(['prefix' => 'user'], function () {
    Route::get('/active', 'user\UserInfoController@userActive');
    Route::get('/info/{id}', 'user\UserInfoController@info')->middleware('auth')->name('users.show');
    Route::get('/edit', 'user\UserInfoController@edit')->middleware('auth');
    Route::patch('/update', 'user\UserInfoController@update')->middleware('auth');
    Route::get('/edit/avatar', 'user\UserInfoController@avatar')->middleware('auth');
    Route::patch('/update_avatar', 'user\UserInfoController@updateAvatar')->middleware('auth');
    Route::get('/edit/binding', 'user\UserInfoController@binding')->middleware('auth');
    Route::get('/edit/notify', 'user\UserInfoController@notify')->middleware('auth');
    Route::post('/update/notify', 'user\UserInfoController@updateNotify')->middleware('auth');
});
Route::get('/notifications', 'user\UserInfoController@notifications')->middleware('auth');
Route::post('/upload/image', 'others\UploadFileController@imageUpload')->middleware('auth');
Route::post('/upload/img', 'others\UploadFileController@imgUpload')->middleware('auth')->name('upload_img');
Route::get('/file/{id}', 'others\UploadFileController@getFile');
Route::group(['prefix' => 'forum'], function () {
    Route::get('/', 'forum\ForumController@index');
    Route::get('/plate/{id}', 'forum\ForumController@plate');
    Route::get('/topic/{id}', 'forum\TopicController@topic')->name('topic');
});
Route::post('/plate/migration', 'forum\ForumController@getMigration')->middleware('auth');
Route::group(['prefix' => 'topic', 'middleware' => 'auth'], function () {
    Route::post('/submit', 'forum\TopicController@submitTopic');
    Route::get('/create', 'forum\TopicController@createTopic');
    Route::post('/reply', 'forum\TopicController@reply');
    Route::get('/edit/{id}', 'forum\TopicController@edit');
    Route::post('/update', 'forum\TopicController@update');
    Route::post('/reply/vote', 'forum\TopicController@replyVote');
    Route::post('/delete', 'forum\TopicController@delete');
    Route::post('/vote', 'forum\TopicController@vote');
});

Route::group(['prefix' => 'admin', 'middleware' => 'auth'], function () {
    Route::get('/index', 'admin\AdminController@index')->name('admin_index');
    Route::get('/dashboard', 'admin\AdminController@index');
    Route::get('/user', 'admin\UserController@user');
    Route::get('/user/list', 'admin\UserController@userList');
    Route::get('/user/edit', 'admin\UserController@userEdit');
    Route::get('/user/role', 'admin\UserController@role');
    Route::get('/user/role/get', 'admin\UserController@roleGet');
    Route::post('/user/role/edit', 'admin\UserController@roleEdit');
    Route::patch('/user/info/update', 'admin\UserController@userEditUpdate');
    Route::get('/topic', 'admin\TopicAdminController@index');
    Route::get('/topic/list', 'admin\TopicAdminController@topics');
    Route::post('/topic/del', 'admin\TopicAdminController@del');
    Route::get('/topic/trash', 'admin\TopicAdminController@trash');
    Route::post('/topic/action', 'admin\TopicAdminController@action');
    Route::get('/topic/repay', 'admin\TopicAdminController@reply');
    Route::post('/reply/action', 'admin\TopicAdminController@replyAction');
    Route::get('/topic/partitions', 'admin\TopicAdminController@partitions');
    Route::post('/plate/action', 'admin\TopicAdminController@plateAction');
    Route::patch('/plate/pull', 'admin\TopicAdminController@platePull');
    Route::post('/plate/get', 'admin\TopicAdminController@getPlate');
    Route::get('/plate/del', 'admin\TopicAdminController@plateDel');
    Route::get('/plate/tags', 'admin\TopicAdminController@plateTags');
    Route::post('/tags/action', 'admin\TopicAdminController@tagsAction');
    Route::post('/tags/get', 'admin\TopicAdminController@tagsGet');
    Route::post('/tags/pull', 'admin\TopicAdminController@tagsPull');
    Route::get('/plate/get/tags', 'admin\TopicAdminController@plateGetTags');
    Route::post('/plate/tag/add', 'admin\TopicAdminController@plateTagAdd');
    Route::post('/plate/tag/del', 'admin\TopicAdminController@plateTagDel');
    Route::get('/plate/get/admin', 'admin\TopicAdminController@plateGetAdmins');
    Route::post('/mod/add', 'admin\TopicAdminController@modAdd');
    Route::post('/mod/del', 'admin\TopicAdminController@modDel');
});

Route::group(['prefix' => 'error'], function () {
    Route::get('/pass', 'ErrorController@pass');
});

Route::get('/ad', function () {return 233;});
